#include <iostream>
#include <cstdio>
#include <queue>
#include <vector>
#define INF 1 << 30
using namespace std;
typedef long long ll;
constexpr int MAXN = 10000000;
ll N, S;
ll c[MAXN], y[MAXN];
int main() {
    ll res = 0;
    scanf("%lld %lld", &N, &S);
    for (int i = 0; i < N; i++) scanf("%lld %lld", c + i, y + i);
    for (int i = 1; i < N; i++) c[i] = min(c[i], c[i - 1] + S);
    for (int i = 0; i < N; i++) res += c[i] * y[i];
    cout << res << endl;
}
